package net.zdreamer.shunyi.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import net.zdreamer.shunyi.R;
import net.zdreamer.shunyi.utils.ListUtils.MessageInfos.MessageInfo;
import net.zdreamer.shunyi.utils.ViewHolder;

import java.util.List;

/**
 * Created by Admin on 2014/12/25.
 */
public class MessageListAdapter extends MyBaseAdapter<MessageInfo> {
    public MessageListAdapter(Context context, List<MessageInfo> list, int res) {
        super(context, list, res);
    }

    @Override
    protected View getView(int position, View convertView, ViewGroup parent,MessageInfo value) {
        TextView lettername=(TextView) ViewHolder.get(convertView, R.id.lettername);
        TextView lettersign=(TextView)ViewHolder.get(convertView,R.id.lettersign);
        TextView lettertime=(TextView)ViewHolder.get(convertView,R.id.lettertime);
        ImageView letterimg=(ImageView)ViewHolder.get(convertView,R.id.lettertouxiang);


        letterimg.setImageResource(value.imageURL.get(position).get("touxiang"));
        lettername.setText(value.name);
        lettersign.setText(value.signature);
        lettertime.setText(value.time);
        return convertView;
    }
}
